

strana 133
----------
<TextBlock>
  <Run FontSize="20" Text="Toto je "/>
  <Run FontSize="20" FontStyle="Italic" Text="formtovan "/>
  <Run FontSize="20" Text="text"/>
  <LineBreak/>
  <Run Foreground="Red" FontSize="24" Text="Dal text."/>
</TextBlock>




strana 134
----------
<Canvas>
  <Border BorderBrush="Black" BorderThickness="1" 
    Canvas.Left="10" Canvas.Top="10">
    <TextBlock Text="'Babylonsk rybka,' odkval tie 
      Stopav prvodce po Galaxii, 'je mal, lut, 
      trochu se podob pijavici.'"/>
  </Border>

  <Border BorderBrush="Black" BorderThickness="1" 
    Canvas.Left="10" Canvas.Top="50">
    <TextBlock Text="'Babylonsk rybka,' odkval tie 
      Stopav prvodce po Galaxii, 'je mal, lut, 
      trochu se podob pijavici.'" 
      TextWrapping="Wrap" Width="200"/>
  </Border>
</Canvas>


<TextBlock TextWrapping="Wrap" Width="300" >
  <TextBlock.Foreground>
    <LinearGradientBrush EndPoint="0,0" StartPoint="1,1">
      <GradientStop Color="Yellow"/>
      <GradientStop Color="Black" Offset="1"/>
      <GradientStop Color="Red" Offset="0.3"/>
      <GradientStop Color="Blue"  Offset="0.6"/>
    </LinearGradientBrush>
  </TextBlock.Foreground>
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, 
  sed do eiusmod tempor incididunt ut labore et dolore magna 
  aliqua. Ut enim ad minim veniam, quis nostrud exercitation 
  ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis 
  aute irure dolor in reprehenderit in voluptate velit esse cillum 
  dolore eu fugiat nulla pariatur. Excepteur sint occaecat 
  cupidatat non proident, sunt in culpa qui officia deserunt mollit 
  anim id est laborum
</TextBlock>



strana 135
----------
<TextBlock TextWrapping="Wrap">
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor 
  incididunt ut labore et dolore magna aliqua. 
  <Run FontFamily="Arial Black" FontSize="14">Ut enim ad minim veniam, quis nostrud 
  exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</Run> 
  <LineBreak />
  <Run Foreground="Orange" FontWeight="Bold">Nullam nulla.</Run> Duis aute irure dolor 
  in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla 
  pariatur. 
  <Run FontFamily="Courier New">Excepteur sint occaecat cupidatat non proident, sunt   
  in culpa qui officia deserunt mollit anim id est laborum.</Run>
</TextBlock>





strana 136
----------
<TextBlock Margin="20" FontFamily="Verdana" FontSize="120" FontWeight="Bold">
  DESIGN
  <TextBlock.Foreground>
    <ImageBrush ImageSource="c:\\foto\lampy.JPG"/>
  </TextBlock.Foreground>
</TextBlock>





strana 137
----------
<Canvas>
  <TextBox Canvas.Top="30" Canvas.Left="120" Width="200"/>

  <TextBox Canvas.Top="60" Canvas.Left="120" 
    Height="150" Width="200" AcceptsReturn="True" 
    HorizontalScrollBarVisibility="Visible"
    VerticalScrollBarVisibility="Visible" 
    TextWrapping="Wrap" Text="'Babylonsk rybka,' odkval 
    tie Stopav prvodce po Galaxii, 'je mal, lut, 
    trochu se podob pijavici.'"/>
</Canvas>





strana 138
----------
<StackPanel Margin="20,10,0,0" >
  <TextBlock  Text="Heslo:" />
  <PasswordBox x:Name="Heslo" PasswordChanged="PwdChanged" 
    Height="25" Width="200" HorizontalAlignment="Left" />
  <TextBlock Text="Zobrazen zadvanch znak" />
  <TextBox x:Name="ZobrazHeslo" HorizontalAlignment="Left" 
    IsReadOnly="True" Height="25" Width="200" />
</StackPanel>


private void PwdChanged(object sender,RoutedEventArgs e)
{
  ZobrazHeslo.Text = Heslo.Password;
}



strana 145
----------
<StackPanel Background="White" Margin="10">
  <CheckBox x:Name="cb1" IsChecked="True" Content="Checked"/>
  <CheckBox x:Name="cb2" IsChecked="False" Content="Unchecked"/>
  <CheckBox x:Name="cb3" IsChecked="" IsThreeState="True" 
    Content="Indeterminate"/>
</StackPanel>


<StackPanel> 
  <CheckBox Checked="CheckBox_Checked" Unchecked="CheckBox_Checked" 
    IsThreeState="True" Content="Test"> 
  /CheckBox>

  <CheckBox Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked"> 
    <CheckBox.Content> 
      <StackPanel Orientation="Horizontal"> 
        <TextBlock Text="Nastaveni">
        </TextBlock> 
        <Image Source="tool.jpg"/> 
      </StackPanel> 
    </CheckBox.Content> 
  </CheckBox> 
</StackPanel>


strana 146
----------
private void CheckBox_Checked(object sender, RoutedEventArgs e) 
{
  CheckBox c = (CheckBox)sender; 
  bool b = (bool)c.IsChecked; 
}


private void CheckBox_Unchecked(object sender, RoutedEventArgs e) 
{
  CheckBox c = (CheckBox)sender; 
  bool b = (bool)c.IsChecked; 
}








strana 147
----------
<StackPanel Orientation="Vertical" Background="LightGray"> 
  <RadioButton Content="Poloka 1" IsChecked="true" ></RadioButton> 
  <RadioButton Content="Poloka 2"></RadioButton> 
  <RadioButton Content="Poloka 3"></RadioButton> 
  <RadioButton Content="Poloka 4"></RadioButton> 
</StackPanel>

<StackPanel Orientation="Vertical" Background="White"> 
  <RadioButton Content="Poloka 5" IsChecked="true"></RadioButton> 
  <RadioButton Content="Poloka 6"></RadioButton> 
  <RadioButton Content="Poloka 7"></RadioButton> 
  <RadioButton Content="Poloka 8"></RadioButton>
</StackPanel> 



<StackPanel Orientation="Vertical"> 
  <RadioButton GroupName="1" Content="Poloka 1" IsChecked="true" >
  </RadioButton> 
  <RadioButton GroupName="1" Content="Poloka 2"></RadioButton> 
  <RadioButton GroupName="1" Content="Poloka 3"></RadioButton> 
  <RadioButton GroupName="1" Content="Poloka 4"></RadioButton> 
  <RadioButton GroupName="2" Content="Poloka 5"></RadioButton> 
  <RadioButton GroupName="2" Content="Poloka 6"></RadioButton> 
  <RadioButton GroupName="2" Content="Poloka 7"></RadioButton> 
  <RadioButton GroupName="2" Content="Poloka 8"></RadioButton> 
</StackPanel>


strana 149
----------
<Grid x:Name="LayoutRoot" Background="White" >
  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="0.1*"/>
    <ColumnDefinition Width="0.9*"/>
  </Grid.ColumnDefinitions>

  <ScrollBar Orientation="Vertical" Grid.Column="0" Width="25" Height="200"/>
  <ScrollBar Orientation="Horizontal" Grid.Column="1"  Width="300" Height="25"/>
</Grid>




strana 150
----------
<Grid x:Name="LayoutRoot" Background="White" >
  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="0.1*"/>
    <ColumnDefinition Width="0.9*"/>
  </Grid.ColumnDefinitions>

  <Slider Orientation="Vertical" Grid.Column="0" 
    Width="25" Height="200" Minimum="0" Maximum="100" 
    SmallChange="1" LargeChange="10" Value="50"/>
  <Slider Orientation="Horizontal" Grid.Column="1" 
    Width="300" Height="25"/>
</Grid>



<StackPanel>
  <TextBlock Text="Klasick Progress Bar"/>
  <ProgressBar Height="20" Width="300" IsIndeterminate="False"
    Minimum ="0" Maximum="100" Value="25" Foreground="Green"/>

  <TextBlock Text="Grafick imitace pohybu"/>
  <ProgressBar Height="20" Width="300" IsIndeterminate="True"/>
</StackPanel>






strana 151
----------
<StackPanel>
  <ListBox Name="lb" Width="200" SelectionChanged="ZobrazText" 
    SelectionMode="Single">
    <ListBox.Items>
      <ListBoxItem Content="Poloka 1"/>
      <ListBoxItem Content="Poloka 2"/>
      <ListBoxItem Content="Poloka 3"/>
      <ListBoxItem Content="Poloka 4"/>
    </ListBox.Items>
  </ListBox>

  <TextBlock Text="Vybran text" Width="200" />
  <TextBox Name="tb" Width="140" Height="30"></TextBox>
</StackPanel>


void ZobrazText(object sender, SelectionChangedEventArgs args)
{
  ListBoxItem lbi = ((sender as ListBox).SelectedItem as ListBoxItem);
  tb.Text = lbi.Content.ToString();
}




strana 152
----------
namespace prvky
{
  public partial class MainPage : UserControl
  {
    public MainPage()
    {
      InitializeComponent();
      lb1.ItemsSource = Zakaznik.DejSeznam(); //pipojen na prvek
    }
  }

  public class Zakaznik
  {
    public String Jmeno { get; set; }
    public String Adresa { get; set; }

    public Zakaznik(String jmeno, String adresa)
    {
      this.Jmeno = jmeno;
      this.Adresa = adresa;
    }

    public static List<Zakaznik> DajSeznam()
    {
      return new List<Zakaznik>(new Zakaznik[3] 
      {
        new Zakaznik("Jan Novk", "Gagarinova 54 Prievidza"), 
        new Zakaznik("Zuzana Tich", "Komjatna 1367"),
        new Zakaznik("Emil Skokan", "Krna 33 Bratislava"),
      });
    }
  }
}





strana 154
----------
<ListBox x:Name="lb1" Margin="5" ItemsSource="{Binding Mode=OneWay}" >
  <ListBox.ItemTemplate>
    <DataTemplate>
      <StackPanel Orientation="Horizontal" >
        <TextBlock Text="{Binding Jmeno}" Margin="0,0,50,0" />
        <TextBlock Text="{Binding Adresa}" />
      </StackPanel>
    </DataTemplate>
  </ListBox.ItemTemplate>
</ListBox>



<ComboBox Width="100"> 
  <ComboBox.Items > 
    <ComboBoxItem Content="Poloka 1"></ComboBoxItem> 
    <ComboBoxItem Content="Poloka 3"></ComboBoxItem> 
    <ComboBoxItem Content="Poloka 3"></ComboBoxItem> 
  </ComboBox.Items> 
</ComboBox>


<ComboBox Width="100"> 
  <ComboBox.Items > 
    <ComboBoxItem Content="Poloka 1"></ComboBoxItem> 
    <ComboBoxItem Content="Poloka 3"></ComboBoxItem> 
    <ComboBoxItem Content="Poloka 3" IsSelected="True">
    </ComboBoxItem>
  </ComboBox.Items> 
</ComboBox>




strana 156
----------
<ComboBox>
  <ComboBoxItem><TextBlock Text="Poloka 1"></TextBlock></ComboBoxItem>
  <ComboBoxItem><TextBlock Text="Poloka 2"></TextBlock></ComboBoxItem>
  <ComboBoxItem><TextBlock Text="Poloka 3"></TextBlock></ComboBoxItem>
</ComboBox>




strana 155
----------
XAML:
<Grid x:Name="LayoutRoot" Background="White" ShowGridLines="True">
  <Canvas x:Name="Plocha"> 

  </Canvas>
</Grid> 



C#:
using System.Collections.Generic;

namespace kontejner1
{
  pulic class Clen
  {
    public string Jmeno { get; set; }
    public int Vek { get; set; }
  }

  public partial class MainPage : UserControl
  {

    ComboBox cbClenove = new ComboBox();

    public MainPage()
    {
      InitializeComponent();

      List<Clen> clenList = new List<Clen>();
      clenList.Add(new Clen() { Jmeno = "Novk Jan", Vek = 45 });
      clenList.Add(new Clen() { Jmeno = "Zounarov Iveta", Vek = 37 });
      clenList.Add(new Clen() { Jmeno = "Koutn Zuzana", Vek = 22 });
      ComboBox cb = new ComboBox();
      cbClenove.DisplayMemberPath = "Jmeno";
      cbClenove.ItemsSource = clenList;
      cbClenove.SelectedIndex = 2;
      cbClenove.SelectionChanged += new 
      SelectionChangedEventHandler(cb_SelectionChanged);
      Plocha.Children.Add(cbClenove);
    }

    void cb_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
      Clen vybranyClen = (Clen) cbClenove.SelectedItem;
      int vek = vybranyClen.Vek;
      string jmeno = vybranyClen.Jmeno;
    }

  }
}




strana 156
----------
<controls:TreeView Name="tv" >
  <controls:TreeViewItem Header="Jdlo" IsSelected="True">
    <controls:TreeViewItem Header="Lasagne"/>
    <controls:TreeViewItem Header="Dodavatel">
      <controls:TreeViewItem Header="Unifood s.r.o"/>
    </controls:TreeViewItem>

    <controls:TreeViewItem Header="Balen">
      <controls:TreeViewItem Header="Plastov tcek"/>
      <controls:TreeViewItem Header="Aluminiov tcek"/>
    </controls:TreeViewItem>
  </controls:TreeViewItem>

  <controls:TreeViewItem Header="Npoj" IsSelected="True">
    <controls:TreeViewItem Header="Star Cola"/>
    <controls:TreeViewItem Header="Dodavatel">
      <controls:TreeViewItem Header="Unidrink s.r.o"/>
    </controls:TreeViewItem>

    <controls:TreeViewItem Header="Balen">
      <controls:TreeViewItem Header="Lhev 0.5l"/>
      <controls:TreeViewItem Header="Lhev 1.5l"/>
      <controls:TreeViewItem Header="Plechovka 0.3l"/>
      <controls:TreeViewItem Header="Plechovka 0.5l"/>
    </controls:TreeViewItem>
  </controls:TreeViewItem>

</controls:TreeView>





strana 157
----------
XAML:
<Grid x:Name="LayoutRoot" Background="White" ShowGridLines="True">
<controls:TreeView x:Name="tvStruktura" 
  HorizontalAlignment ="Left" Background="LightGray" />
</Grid> 



C#:
public partial class MainPage : UserControl
{

  public MainPage()
  {
    InitializeComponent();
    Zaznamy root = Zaznamy.PripravaDat();
    NaplnStrom( tvStruktura.Items, root );
  }

  private void NaplnStrom( ItemCollection itemColl, Zaznamy dataNode )
  {
    TreeViewItem tvi = new TreeViewItem();
    itemColl.Add( tvi );
    tvi.Header = dataNode.Jmeno;
    foreach ( Zaznamy childDataNode in dataNode.Children )
    {
      NaplnStrom( tvi.Items, childDataNode ); 
    }
  }

}

public class Zaznamy
{
  public string Jmeno { get; set; }
  public Zaznamy Parent { get; set; }
  public List<Zaznamy> Children;
  public int Depth  { get { return Parent == null ? 0 : Parent.Depth +1; } }

  public Zaznamy()
  {
    Jmeno=string.Empty;
    Parent = null;
    Children = new List<Zaznamy>();
  }

  public Zaznamy CreateChild( string jmeno )
  {
    Zaznamy child = new Zaznamy() { Jmeno = jmeno, Parent = this};
    Children.Add(child);
    return child;
  }

  public static Zaznamy PripravaDat()
  {
    Zaznamy root = new Zaznamy() { Jmeno = "esk replublika" };
    Zaznamy kraje = root.CreateChild( "zemn kraje" );
    kraje.CreateChild( "Stedoesk kraj" ).CreateChild( "Praha" );
    kraje.CreateChild( "Jihoesk kraj" ).CreateChild( "esk Budjovice" );
    kraje.CreateChild( "Zpadoesk kraj" ).CreateChild( "Plze" );
    kraje.CreateChild( "Severoesk kraj" ).CreateChild( "st nad Labem" );
    kraje.CreateChild( "Vchodoesk kraj" ).CreateChild( "Hradec Krlov" );
    kraje.CreateChild( "Jihomoravsk kraj" ).CreateChild( "Brno" );
    kraje.CreateChild( "Severomoravsk kraj" ).CreateChild( "Ostrava" );

    Zaznamy prezidenti = root.CreateChild( "Prezidenti" );
    Zaznamy VH = prezidenti.CreateChild( "Vclav Havel" );
    Zaznamy VH_O = VH.CreateChild( "Mandty" );
    VH_O.CreateChild( "1993" );
    VH_O.CreateChild( "1998" );
    Zaznamy VK = prezidenti.CreateChild( "Vclav Klaus" );
    Zaznamy VK_O = VK.CreateChild( " Mandty " );
    VK_O.CreateChild( "2003" );

    return root;
  }

}



strana 159
----------
<controls:HeaderedItemsControl x:Name="hicPolozky" 
  xmlns:sys="clr-namespace:System;assembly=mscorlib">
  <controls:HeaderedItemsControl.Header>
    <TextBlock FontSize="16" Text="Poloky" TextDecorations="Underline"/>
  </controls:HeaderedItemsControl.Header>

  <sys:String>Poloka 1</sys:String>
  <sys:String>Poloka 2</sys:String>
  <sys:String>Poloka 3</sys:String>
  <sys:String>Poloka 4</sys:String>
</controls:HeaderedItemsControl>


<controls:HeaderedItemsControl x:Name="hicPolozky">
  <controls:HeaderedItemsControl.Header>
    <TextBlock FontSize="16" Text="Poloky" 
      TextDecorations="Underline"/>
  </controls:HeaderedItemsControl.Header>
  <controls:HeaderedItemsControl.ItemTemplate>
    <DataTemplate>
      <TextBlock Text="{Binding}"/>
    </DataTemplate>
  </controls:HeaderedItemsControl.ItemTemplate>
</controls:HeaderedItemsControl> 


C#:
public MainPage()
{
  InitializeComponent();
  string[] polozky = { "Poloka 1", "Poloka 2", "Poloka 3", "Poloka 4" };
  hicPolozky.ItemsSource = polozky;
}


strana 160
----------
<controls:TabControl Width="400" Height="200">
  <controls:TabItem Header= "Karta 1" Content="Obsah karty 1"/> 
  <controls:TabItem Header= "Karta 2" Content="Obsah karty 2"/> 
  <controls:TabItem Header= "Karta 3" Content="Obsah karty 3"/> 
</controls:TabControl> 




<controls:TabControl Width="400" Height="200">
  <controls:TabItem Header= "Karta 1">
    <Canvas Background="LightGray"></Canvas>
  </controls:TabItem> 

  <controls:TabItem Header= "Karta 2">
    <Canvas Background="LightCyan"></Canvas>
  </controls:TabItem> 

  <controls:TabItem Header= "Karta 3">
    <Canvas Background="Yellow"></Canvas>
  </controls:TabItem> 
</controls:TabControl> 




strana 162
----------
<basics:ChildWindow
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:basics="clr-namespace:System.Windows.Controls;
  assembly=System.Windows.Controls"
  x:Class="dialog.OznamWin"
  Title="OznamWin"
  Width="400" Height="300">
  <Grid x:Name="LayoutRoot" Background="White">
    <Grid.RowDefinitions>
      <RowDefinition />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <Button x:Name="OKButton" Content="OK" 
      Click="OKButton_Click" Width="75" Height="23" 
      HorizontalAlignment="Right" Grid.Row="1" />
    <Button x:Name="CancelButton" Content="Cancel" 
      Click="CancelButton_Click" Width="75" Height="23" 
      HorizontalAlignment="Right"  Margin="0,0,79,0" Grid.Row="1" />
  </Grid>
</basics:ChildWindow>


C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace dialog
{
  public partial class OznamWin : ChildWindow
  {
    public OznamWin()
    {
      InitializeComponent();
    }

    private void OKButton_Click(object sender, RoutedEventArgs e)
    {
      this.DialogResult = true;
    }

    private void CancelButton_Click(object sender, RoutedEventArgs e)
    {
      this.DialogResult = false;
    }
  }
}


C#:
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
  ChildWindow1 dlg = new ChildWindow1();
  dlg.Show();
}




strana 163
----------
<basics:ChildWindow
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:basics="clr-namespace:System.Windows.Controls;
  assembly=System.Windows.Controls"
  x:Class="dialog.OznamWin"
  Title="Login"
  Width="400" Height="300"
  Closing="Close">
  <Grid x:Name="LayoutRoot" Background="White">
    <Grid.RowDefinitions>
      <RowDefinition />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <StackPanel>
      <TextBlock Text="Jmno" />
      <TextBox x:Name="jmenoBox"/>
      <TextBlock Text="Heslo" />
      <PasswordBox x:Name="hesloBox"/>
    </StackPanel>

    <Button x:Name="OKButton" Content="OK" 
      Click="OKButton_Click" Width="75" Height="23" 
      HorizontalAlignment="Right" Grid.Row="1" />
    <Button x:Name="CancelButton" Content="Cancel" 
      Click="CancelButton_Click" Width="75" Height="23" 
      HorizontalAlignment="Right"  Margin="0,0,79,0" Grid.Row="1" />
  </Grid>
</basics:ChildWindow>


strana 164
----------
C#:
private void Close(object sender, System.ComponentModel.CancelEventArgs e)
{
  if (this.DialogResult == true && 
    (this.jmenoBox.Text == string.Empty || 
    this.hesloBox.Password == string.Empty))
  {
    e.Cancel = true;
    ChildWindow cw = new ChildWindow();
    cw.Content = "Zadej uivatelsk jmno a heslo, ppadn zru pihlen";
    cw.Show();
  }
}


<Grid x:Name="LayoutRoot" Background="White">
  <Button  Height="30" Width="130" HorizontalAlignment="Left" 
    Margin="30,50,0,0" VerticalAlignment="Top" 
    Content="Pihlen" Click="Button_Click"/>
</Grid>

C#:
private void Button_Click(object sender, System.Windows.RoutedEventArgs e)
{
  OznamWin dlg = new OznamWin();
  dlg.Show();
}





strana 166
----------
<Grid x:Name="LayoutRoot" Background="White" >

  <Grid.RowDefinitions>
    <RowDefinition Height="0.1*"/>
    <RowDefinition Height="0.9*"/>
  </Grid.RowDefinitions>

  <Button x:Name="btPopup" Height="30" Width="100" 
    Content="Zobraz okno" />

  <Popup x:Name="popupOznam" VerticalOffset="50" 
    HorizontalOffset="30">
    <Border BorderBrush="Blue" BorderThickness="5">
      <StackPanel x:Name="PopUpPanel" Background="LightGray"
        Height="Auto" Width="Auto" >
        <TextBlock  x:Name="PopUpText" FontSize="20" Height="80" 
          Width="Auto" Text="Pozor na sprvn zadn 
          variabilnho symbolu" HorizontalAlignment="Center" 
          VerticalAlignment="Center" Foreground="Red"/>
        <Button x:Name="btZavri"  Height="30"  Width="100" 
          Content="Zavi okno" />
      </StackPanel>
    </Border>
  </Popup>

</Grid>


C#:
public MainPage()
{
  InitializeComponent();
  btPopup.Click += new RoutedEventHandler(ZobrazPopup);
  btZavri.Click += new RoutedEventHandler(ZavriPopup);
}

void ZobrazPopup(object sender, RoutedEventArgs e)
{
  popupOznam.IsOpen = true;
}

void ZavriPopup(object sender, RoutedEventArgs e)
{
  popupOznam.IsOpen = false;
}


strana 167
----------
<ScrollViewer Height="200" Width="200" 
  HorizontalScrollBarVisibility="Auto" 
  Canvas.Top="60" Canvas.Left="340">
  <TextBlock Width="300" TextWrapping="Wrap" Text="
  Lorem ipsum dolor sit amet, consectetur adipisicing elit, 
  sed do eiusmod tempor incididunt ut labore et dolore magna 
  aliqua. Ut enim ad minim veniam, quis nostrud exercitation 
  ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis 
  aute irure dolor in reprehenderit in voluptate velit esse cillum 
  dolore eu fugiat nulla pariatur. Excepteur sint occaecat 
  cupidatat non proident, sunt in culpa qui officia deserunt mollit 
  anim id est laborum" />
</ScrollViewer>




strana 168
----------
<Grid x:Name="LayoutRoot" Background="White">
  <Slider Width="400" Minimum="0" Maximum="400" 
    Value="200" x:Name="reg"/>
  <Ellipse Height="100" Fill="Blue" 
    Width="{Binding ElementName=reg, Path=Value}" 
    Margin ="200,75,224,0" VerticalAlignment="Top" 
    d:LayoutOverrides="Height"/>
</Grid>




<Grid x:Name="LayoutRoot" Background="White" >
  <StackPanel>
    <TextBlock Text="{Binding Value, 
      ElementName=Potenciometer, Mode=OneWay}" 
      HorizontalAlignment="Center" Width="200"/>
    <Slider Width="300" x:Name="Potenciometer"/>
  </StackPanel>
</Grid>






strana 169
----------
<Canvas>
  <Button x:Name="bt1" Canvas.Top="50" Canvas.Left="20" 
    Content="Test" ToolTipService.ToolTip="Test funkcionality 
    serverovch modul" />

  <TextBlock Text="Zazen zapnut" 
    Canvas.Top="100" Canvas.Left="20" >
    <ToolTipService.ToolTip > 
      <ToolTip Content="Informace o stavu monitorovanho zazen." 
        HorizontalOffset="20" VerticalOffset="20"/>
    </ToolTipService.ToolTip>
  </TextBlock>
</Canvas>



strana 170
----------
<ListBox Width="100" x:Name="lb1" ToolTipService.ToolTip="ToolTip" 
  ToolTipService.Placement="Right" >
  <ListBox.Items>
    <ListBoxItem Content="Left" ToolTipService.ToolTip="Text vlevo." 
      ToolTipService.Placement="Left" />
    <ListBoxItem Content="Right" ToolTipService.ToolTip="Text vpravo." 
      ToolTipService.Placement="Right" />
    <ListBoxItem Content="Top" ToolTipService.ToolTip="Text nahoe." 
      ToolTipService.Placement="Top" />
    <ListBoxItem Content="Bottom" ToolTipService.ToolTip="Text dole." 
      ToolTipService.Placement="Bottom"/>
    <ListBoxItem Content="Mouse" 
      ToolTipService.ToolTip="Text podle kurzoru myi." 
      ToolTipService.Placement="Mouse"/>
  </ListBox.Items>
</ListBox>



strana 172
----------


<Border BorderThickness="3" BorderBrush="Black">
  <StackPanel Background="LightGray">
    <StackPanel  Orientation="Horizontal">
      <TextBlock Text="Stt USA: " Margin="5" VerticalAlignment="Center" />
      <input:AutoCompleteBox x:Name="statyACB" Width="200" />
    </StackPanel>
  </StackPanel>
</Border>

C#:
using System.Collections.Generic;

public MainPage()
{
  // Required to initialize variables
  InitializeComponent();

  List<string> staty = new List<string>();
  staty.Add("Alabama");
  staty.Add("Aljaka");
  staty.Add("Arizona");
  staty.Add("Arkansas");
  staty.Add("Colorado");
  staty.Add("Connecticut");
  staty.Add("Delaware");
  staty.Add("Florida");
  staty.Add("Georgia");
  staty.Add("Havaj");
  staty.Add("Idaho");
  staty.Add("Illinois");
  staty.Add("Indiana");
  staty.Add("Iowa");
  ...
  statyACB.ItemsSource = staty;
} 


